# -*- coding: utf-8 -*-
"""
@Project: base_python
@File: scrapetest.py
@Author: PC
@Date: 2025/04/29
@Description: 
"""

from urllib.request import urlopen
from bs4 import BeautifulSoup
import re


html = urlopen('http://www.pythonscraping.com/pages/page3.html')
bs = BeautifulSoup(html, 'html.parser')
images = bs.find_all('img', {'src': re.compile(r'../img/gifts/img.*.jpg')})
# print(images)
for image in images:
    print(image['src'])



    